<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

$cakeDescription = __d('iso', 'ISO');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		//echo $this->Html->meta('icon');

		//echo $this->Html->css('cake.generic');
		echo $this->Html->css('bootstrap.min.css');
		echo $this->Html->css('docs.css');
	?>
	<link href="/css/jquery-ui-1.7.2.css" type="text/css" rel="stylesheet" media="screen" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<!--<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>-->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/googleapis/0.0.4/googleapis.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/jsapi"></script>
<script type="text/javascript">
  google.load("identitytoolkit", "1.0", {packages: ["ac"]});
</script>

<script type="text/javascript">
  $(function() {
    window.google.identitytoolkit.setConfig({
        developerKey: "AIzaSyBpYpzAKWnPp9yLwu4nD-_NIofyXRTIw70",
        companyName: "ISO SBM ITB",
        //callbackUrl: "http://iso.local/users/callback",
        //realm: "",
        //userStatusUrl: "http://iso.local/users/userStatus",
        //loginUrl: "http://iso.local/users/userLogin",
        //signupUrl: "http://iso.local/users/userSignup",
        //homeUrl: "http://iso.local/logs",
        //logoutUrl: "http://iso.local/users/userSignout",
        language: "en",
        //idps: ["Gmail", "Yahoo"],
        //tryFederatedFirst: true,
        useCachedUserStatus: false,
        dropdownmenu: [ 
			{ 
			  "label": "Edit profile", 
			  "url": "/myprofile"
			},
			{ 
			  "label": "Log out",
			  "url": "/users/logoutAll"
			},
			{ 
			  "label": "Log out from ISO only",
			  "url": "/logout"
			}
		]
    });
    var options = {	};
	<?php if (isset($_SESSION['UserAuth']['User'])) { ?>
		options['signedIn'] = true;
		options['email'] = '<?php echo $_SESSION['UserAuth']['User']['email']; ?>';
		options['displayName'] = '<?php echo $_SESSION['UserAuth']['User']['fullname']; ?>';
		options['legacy'] = true;
		//options['photoUrl'] = '<?php if(!empty($_SESSION['UserAuth']['User']['picture'])){ if(file_exists('img'.DS.'thumbs'.DS.$_SESSION['UserAuth']['User']['picture'])){ echo DS.'img'.DS.'thumbs'.DS.$_SESSION['UserAuth']['User']['picture']; } } ?>';
	<?php } ?>

    $("#navbar").accountChooser(options);
    setInterval( function(){
		$('div.widget-header h1').text('Sign in to ISO');
		$('div.widget-email-box h2').text('Type your SBM ITB email');
		$('div.widget-nascar-list h2').text("Don't have SBM ITB email? sign in with");
	}, 500 );
  });
</script>

	<script src="/js/bootstrap.min.js"></script>
	<?php
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<style>
	#popin-box div ol{
		clear:both;
	}
	#popin-box div h2{
		float:none;
		font-size:1.3em;
	}
	#popin-box .widget-nascar-list {
		border: 0 none;
		float: right;
		margin: 1em 1.4em;
		padding: 0;
		width: 290px;
	}
	#popin-box .widget-email-box {
		border-top: 0px;
		border-right: 1px solid #EEEEEE;
		float: left;
		margin: 1em 0 1em 2em;
		padding-right: 25px;
		padding-top: 0px;
	}
	#popin-box .widget-input-big {
		width: 240px;
		margin-right:10px;
	}
	#popin-box div.widget-ac-more-add {
		display: none;
	}
	#popin-box li.widget-idp {
		border-radius: 4px 4px 4px 4px;
		width: 100%;
	}
	#popin-box .widget-header-error {
		width: 400px;
	}
</style>
<body>
	<?php echo $this->element('nav'); ?>
	<?php echo $this->fetch('content'); ?>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>
